package com.rzn.reading;

import org.springframework.context.MessageSource;
import org.springframework.context.i18n.LocaleContextHolder;


public class MessageUtil {
    private static final MessageSource MESSAGE_SOURCE;

    static{
        MESSAGE_SOURCE = ApplicationContextUtil.getApplicationContext().getBean(MessageSource.class);
    }

    public static String getMessage(String key, Object... args){
        return MESSAGE_SOURCE.getMessage(key,args, LocaleContextHolder.getLocale());
    }
}
